/**
  * Author: Mei
  * Date: 2021-01-13 14:07
  * Description: 
  *
  */
#include "LinqCpp.cpp"

using namespace cosmos;

struct A {
    int val_;

    A(int va) : val_(va) {
        cout << "exec" << endl;
    }

    int value() { return val_; }

};

struct B {
private:
    int n;
public:
    B(int s) : n(s) {}

    auto show() -> decltype(2 + n) {
        return 2 + n;
    }

};

int main() {
    auto fn = to_function([](int i) {
        cout << "show time" << endl;
    });
    vector<int> v{1, 2, 3, 4, 5, 6};
    vector<int> v1{5, 2, 4, 9, 8, 6, 2, 9};
    vector<int> v2{6, 6, 6};

    //auto linq = where([](int i) {
    //    return i > 3;
    //});
    from(v1)
            .skipwhile([](int i) {
                return i > 3;
            })
                    //.select([](int i) {
                    //    return i + 2;
                    //})
                    //.take(4)
            .for_each([](int i) {
                cout << i << " ";
            });
    cout << "\n----------------" << endl;
    //from(v1).cast(5);
    auto res = zip(v, v1, v2);
    cout <<"size: "<< res.size() << endl;
    for (auto item = res.begin(); item != res.end(); ++item) {
        for (auto it = item->begin(); it != item->end(); ++it)
            cout << *it << endl;
    }
    //.for_each([](int i) {
    //    cout << i << " ";
    //});
    //cout << m_pair[2];
    //cout << *iter << endl;

    //decltype(std::declval<decltype(v)>().begin()) it;
    return 0;
}